package cn.operation.backend.util;


public class BusinessException extends RuntimeException {
    private static final long serialVersionUID = 2332608236621015980L;
    private boolean success;
    private String messageCode;
    private String message;

    public BusinessException() {
    }

    public BusinessException(String message) {
        super(message);
        this.message = message;
    }

    public BusinessException(String messageCode, String message) {
        super(message);
        this.message = message;
        this.messageCode = messageCode;
    }

    public BusinessException(Throwable cause) {
        super(cause);
    }

    public BusinessException(String messageCode, String message, Throwable cause) {
        super(message, cause);
        this.messageCode = messageCode;
        this.message = message;
    }

    public BusinessException(String messageCode, String message, boolean isSuccess, Throwable cause) {
        super(message, cause);
        this.messageCode = messageCode;
        this.message = message;
        this.success = isSuccess;
    }

    public boolean isSuccess() {
        return this.success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public String getMessage() {
        return this.message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getMessageCode() {
        return this.messageCode;
    }

    public void setMessageCode(String messageCode) {
        this.messageCode = messageCode;
    }

    public String toString() {
        return "BusinessException [success = " + this.isSuccess() + "," + "messageCode = " + this.getMessageCode() + "," + "message = " + this.getMessage() + "]";
    }
}

